home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / AMIGA / (A)TB / (A)TBE.ADF / Utility / README_LS < prev    next >
Text File  |  1989-09-12  |  16KB  |  384 lines

  1. README                ls v4.0k                05/11/90
  2.  
  3. ls v4.0k is (c) Copyright 1990, Kim E. DeVaughn, all rights reserved.
  4.  
  5.  
  6. Introduction:
  7.  
  8. What?!  Another version of "ls" ...?  Why in the world does the world
  9. need Yet Another Version of such a common command?  Actually, that's
  10. the answer (as well as the question).
  11.  
  12. If you kept track of such things (like some operating systems do),
  13. you'd probably find the "most executed" command is by far, "ls" (or
  14. dir, etc).
  15.  
  16. We use "ls" not only to see what's where, but when what's there got
  17. there, how big it is, what it's attributes are, etc. We also use "ls"
  18. to check our spelling, make lists of files, and so forth.
  19.  
  20. Because of this high usage, we'd like it to work the way we think it
  21. ought to, or at least the way we're used to. For alot of people, this
  22. means "like UNIX(R)".*  Not that the UNIX way is the *best* way, but
  23. when you have to deal with UNIX at work, etc, it makes it much more
  24. convenient and productive (not to mention much less error prone), to
  25. have the Amiga environment "similar".  At least in the CLI/shell
  26. environment.
  27.  
  28.      * - UNIX is a registered trademark of AT&T, if you didn't know.
  29. To that end, I've reworked Justin McCormick's "ls" (v3.1) so it's
  30. output and option flags (where applicable) are much closer to UNIX's
  31. implementation, by default. It still isn't a "perfect" emulation, but
  32. it's quite close.
  33.  
  34. Along the way, I've fixed a number of bugs (none terribly major),
  35. added some additional features, and just about run out of letters for
  36. the option flags!
  37.  
  38. If Justin thought "ls" was getting bloated with options in his most
  39. recent rev (v3.1), he'll surely gag after seeing what I've done :-).
  40.  Still, with all the new options, etc, "ls" is only about 16K. And it
  41. can still be made resident, etc. In fact, with the right set of
  42. switches, you can make it behave just like v3.1 (bug fixes excepted)
  43. if you want!
  44.  
  45. The reason for this is that I'm a very firm believer in letting
  46. people "have it their way". I'm sure I could chop out about 4K or
  47. more if I just did it "my way", but other people have other ideas.
  48.  The default way however, *is* "my way".. or actually "the UNIX way".
  49.  
  50.   [ BTW ... if you want this version of "ls" to look/work like v3.1,
  51. the [following switches will do it for you:  -AMSWbemoqv ... :-)]
  52.  
  53. Installation:
  54.  
  55. Just copy "ls" to a directory in your path. If the "p" (pure) bit has
  56. been stripped of somewhere along the way, you can turn it on using
  57. the Protect command (or chmod, etc) if you want to make "ls" a
  58. "resident" command.
  59.  
  60.  
  61. Distribution:
  62.  
  63. Here is a listing of what you should have received in this
  64. distribution:
  65.  
  66. -----rw-d   7     2444  May 10 18:23  License
  67. -----rw-d      33    15901  Jun  5 11:31  README
  68. -----rw-d   4     1204  Jun  5 11:09  README.1ST
  69. ---p-rwxd      34    16028  May 11 02:13  ls
  70. -----rw-d      43    20124  May 11 09:46  ls.doc
  71. d----rwxd   1    0  Jun  5 10:35  src
  72. Dirs: 1    Files: 5 Blocks: 122   Bytes: 54949
  73.  
  74. src:
  75. -----rw-d   2      457  May 10 19:07  Linkfile
  76. -----rw-d   3      590  May 10 18:52  Makefile
  77. -----rw-d     137    65576  May 11 02:02  ls.c
  78. -----rw-d   9     3685  May 10 18:53  ls.h
  79. -----rw-d      73    34948  May 10 18:51  lssup.a
  80. -----rw-d      12     5160  Jul 29  1989  mycres.a
  81. -----rw-d   4     1104  Jul 29  1989  mycres.o
  82. Dirs: 0    Files: 7 Blocks: 240   Bytes: 111520
  83.  
  84. Totals:
  85. Dirs: 1    Files: 12    Blocks: 362   Bytes: 166469
  86.  
  87.  
  88. What's New  (see "ls.doc" for details, etc):
  89.  
  90.     o  New (default) long listing format that *looks* like UNIX's
  91. (except for things like owner, group ID, etc).
  92.  
  93.     o  Block sizes now include *all* blocks associated with a file,
  94. and are finally accurate for FFS devices.
  95.  
  96.     o  By default, upper/lower case *is* significant in the output
  97. listing, and in the wildcard pattern matching.
  98.  
  99.     o  By default, directories and files are intermixed, according to
  100. their alphabetic position.
  101.  
  102.     o  By default, the short listing format uses fixed width columns,
  103. based on the length of the longest filename in the directory.
  104. Variable width columns are still available.
  105.  
  106.     o  By default, "hidden", "*.info", and "dot" files (eg, .foo) are
  107. not displayed. There are switches for each, as well as an "all" flag.
  108.  
  109.     o  Several new options like the ability to limit the "-R"
  110. recursion depth; ability to show absolute and relative path names in
  111. the long format listing; additional control of directory header and
  112. totalization lines; elimination of redundent totalization lines;
  113. showing/sorting on files' "disk keys"; control of the date format;
  114. sort by date/size defaults to newest/biggest first; and a few other
  115. things.
  116.  
  117.     o  Improved error handling and error msgs.  Better "break"
  118. handling. No more "memory leaks" (yes, there is one in v3.1 ... it
  119. looses 300 bytes on an error exit).
  120.  
  121.     o  The assignment of option flags has been "rationalized".
  122.  Applicable flags from the UNIX "ls" were assigned 1st, followed by
  123. other flags from v3.1, followed by new flags added in this rev.
  124. However ... some flag assignments from previous revs were changed
  125. when better mnemonic values could be found, etc. So ... check the
  126. usage, and/or docs. Caveat emptor!
  127.  
  128.     o  Flags requiring arguments (eg, -N) may or may not be seperated
  129. from the argument by spaces. So, "-Nfoo" is just as legal as "-N
  130. foo".
  131.  
  132.  
  133.  
  134. What's Not (yet) Done ... and Limitations/Caveats:
  135.  
  136.     o  Wildcard expansion is still done by "ls", rather than left to
  137. the shell to do so (which is where it should be done, IMHO). This is
  138. to avoid the braindead limitation of being able to pass a command
  139. line of only 255 chars or so max to Exec() under AmigaOS 1.3.
  140.  Hopefully this limit will be removed under AmigaOS 2.0.
  141.  
  142.        This also means that if the shell you're using expands normal
  143. wildcards ("*" and "?") itself, you need to "quote" the wildcards in
  144. some manner for "ls" to work as intended. Depending on the shell you
  145. use, things like "*" or \* or '* may work. See your shell
  146. documentation.
  147.  
  148.     o  Each "fully named path" is still processed seperately, and
  149. will give you an automatic "long format list" for each file
  150.  encountered, or a "short format list" for each subdirectory
  151. encountered. This is why you will get some rather weird output
  152. listings if you let your shell expand wildcards, rather than passing
  153. the wildcards intact to "ls".   (A "fully named path" is a filespec
  154. that contains no wildcards ... in other words, an actual file or dir
  155. name).
  156.  
  157.        This will change. How it wiil change is somewhat dependent on
  158. what is done in AmigaOS 2.0 with command line length limits, links,
  159. etc.
  160.  
  161.     o  Many flag settings get reset to the default values between
  162. each "fully named path". Some do not, and are identified in "ls.doc"
  163. as being "sticky".
  164.  
  165.        This will change when the "fully named path" and wildcard
  166. expansion issues are resolved.
  167.  
  168.     o  Doesn't support AmigaOS v2.0 links (or any other 2.0
  169. enhancements), since CBM hasn't finalized it (besides, I don't have
  170. 2.0 yet). 
  171.  
  172.     o  I want to allow the user to override the default operation
  173. with flags provided in environment variables. This will require
  174. reworking "ls's" startup code (or the use of the standard "cres",
  175. with accompanying bloat of the executable) due to the current env var
  176. implementation as files.  Dumb.
  177.  
  178.     o  The filename arguments required for the -N and -O options must
  179. be fully specified.  Wildcards don't work here.
  180.  
  181.     o  The -N and -O options accept only filenames; they do not
  182. accept actual dates.
  183.  
  184.     o  You must hit "return" to clear the short format's builtin
  185. pager's "More ..." line (see -I), and continue with the listing. I'd
  186. like to change this to being able to hit any key.
  187.  
  188.        Also, the builtin pager works only on a directory-by-directory
  189. basis. It'd be nice (read: this probably won't happen) if it worked
  190. on the output as a whole. And if it worked with the long format
  191. listing.
  192.  
  193.     o  When a long format listing is requested of a "psuedo-device",
  194. the block count may be inaccurate, since such "devices" do not
  195. necessarily have an inherent (or constant) bytes/block value.
  196. Currently, the only such case known are assignments made with the
  197. "pathass" utility. When this situation occurs, a warning message is
  198. issued to the effect that the block counts may be inaccurate.
  199.  
  200.  
  201. Known Bugs:
  202.  
  203.     o  Multiple wildcards in a given path do not work properly. For
  204. example, the command: "ls ls*/*.o" lists the entire contents of the
  205. "ls40" subdirectory, not just the ".o" files.
  206.  
  207.     o  Certain options are slightly incompatible. The known instances
  208. occur with the old (v3.1) long format, and the variable column form
  209. of the short format, as I didn't touch that code much. Known
  210. instances are:
  211.  
  212.        Show keys (-K) does not work with the old (-o) long format.
  213.  
  214.        Append "/" to dir names (-p) does not work with the variable
  215.        column short format (-vp will NOT append a "/"). However, if
  216.        no ANSI escape sequences (-E) is specified along with -v, they
  217.        will be appended to dir names. This is the same behavior as
  218.        "ls" v3.1.
  219.  
  220.     o  Seperate subdir totalization for "fully named path" entries
  221. does not work. However, their contribution to a grand total (-T) is
  222. included.
  223.  
  224.  
  225.  
  226. Quick Look:
  227.  
  228. usage: ls [ [-options <args>]  [names] ] ...
  229.   a  Show dot files   s  Sort by size       M  Ignore case w/wildcard
  230.   b  Show data blks   t  Sort by date       N <name> Show newer than
  231.   c  Show filenotes   u  Usage  [also -?]   O <name> Show older than
  232.   d  Show dirs only   v  Vari col short list  P Show full pathnames
  233.   e  Execute bit is "e"  x <pat> Exclude files  Q Requesters enabled
  234.   f  Show files only     z  Override blk calc   R Recursive listing
  235.   h  Show hidden files   A  Show all  [= -ahi]  S  Show dirs first
  236.   i  Show *.info files   B <blk> Force blk size T  Totals for all
  237.                                                    entries
  238.   k  Sort by disk key    C  Single column list  V  Show rel pathnames
  239.   l  Long listing     D Show dirs last     W  No contents (wild dir)
  240.   m  Mixed case output  E  No ANSI escape codes  X <wide> Set output
  241.                                                     cols
  242.   n  No sort          G  No subdir totals        Y <high> Set output
  243.                                                     rows
  244.   o  Old long list fmt  H No headings        Z  Force ANSI sequences
  245.   p  Append "/" to dirs   I  No page prompts   0-6 Date format (new
  246.                                                    long)
  247.   q  Quit on not found   K  Show disk keys     -  Next arg is
  248.                                                   filename
  249.   r  Reverse sort     L <n> Limited recursion
  250.   F <format> Format output [-o fmt] (default: "%p %d %t %4b %8s
  251.  %n\n")
  252.  
  253.  
  254.  
  255. Tech Notes:
  256.  
  257.     o  This version of "ls" was compiled/assembled using Lattice
  258. v5.05, with optimization on. See the Makefile and Linkfile for
  259. details. Also note that to use the source level debugger "cpr", you
  260. need to use one of the commented out CFLAG strings in the Makefile
  261. with -d3, as well as uncommenting the ADDSYM statement in the
  262. Linkfile.
  263.  
  264.     o  The file "mycres.o" is included, as I couldn't get "mycres.a"
  265. to assemble ... no includes called "exec/funcdef.i" anywhere I could
  266. find, etc. I didn't have a real reason to muck with that code, so I
  267. didn't pursue the matter. The "mycres.o" file is from the v3.1
  268. distribution, and works fine (except when you try using getenv() .).
  269.  
  270.     o  My enhancements to "ls" have evolved bit-by-bit over a period
  271. of about a year. Consequently, the code is somewhat less than
  272. "pristine". I'm sure it can be cleaned up a bit, though I tried to
  273. keep my changes from getting too ugly. Also, I've tried to more or
  274. less stay with Justin's coding style, but I know that hasn't been
  275. completely successful either.
  276.        Anyway, you've been warned; if you go reading the code, send
  277. flames to /dev/null ... :-)
  278.  
  279.  
  280.  
  281. Revision History:
  282.  
  283.     Kim E. DeVaughn
  284.  
  285.     v4.0k  May 11, 1990  Pretty much completely revised the output
  286. formats. Much more like UNIX's "ls" in its output, options, etc.
  287. Several bugs fixed.  Many new options.
  288.  
  289.     Justin V. McCormick
  290.  
  291.     v3.1  July 29, 1989  Bug fixes, new output width and height
  292. options.
  293.     v3.0  July 25, 1989  Instant sorting, best-fit output, new
  294. features.
  295.     v2.2  December 1988  Fixed status return and multiple wildcard
  296. pathnames.
  297.     v2.1  December 1988  Minor size reduction, fixed a few bugs from
  298.  2.0.
  299.     v2.0  November 1988  Revised for Lattice 5.0 and made 1.3 compatible.
  300.     v1.0    August 1986  Written from scratch, my first Amiga project.
  301.  
  302.  
  303.  
  304. Acknowledgements, Etc:
  305.  
  306. First, let me thank Justin McCormick for providing "ls" v3.1, and the
  307. very good algorithms from which I was able to build upon. His inline
  308. sorting in particular made his version the one I chose to enhance
  309. because of it's speed.
  310.  
  311. A very excellent job, and my sincere thanks go to him for a job well
  312. done!
  313.  
  314. Second, let me thank Tom Rokicki for the "date" algorithm I used, and
  315. to Rob Peck for publishing it in his excellent book, "Programmer's
  316. Guide to the Amiga" (Sybex).  Both of these people have contributed
  317. much to the Amiga development community!
  318.  
  319. Third, I want to thank Matt Dillon for providing his fine DME editor,
  320. and many, *many* examples of how to program the Amiga. If you ever
  321. need to know how to do something, take a look a Matt's code ...
  322. chances are he's done it, and in a lean, mean, fast way!
  323.  
  324.  
  325. Finally, I want to mention that this version of "ls" is copyrighted,
  326. whereas Justin's previous versions were explicitly "public domain".
  327. Specifically, I am copyrighting this version of the executable "ls",
  328. the "ls.c" and "ls.h" source files, and the "ls.doc" and "README"
  329. files.
  330.  
  331. This is completely legal, since the base version I used had been
  332. declared to be in the "public domain". I feel totally justified in
  333. doing so due to the extensive changes that I've made.
  334.  
  335. You'll note, if you read the "License", that I'm not trying to
  336. restrict the use or redistribution of this version of "ls", other
  337. than to insure that it isn't used by anyone to make money out of,
  338. myself included. In particular, certain "diskzines" seem to be
  339. unscrupulously "raiding" the freely redistrib-utable software base
  340. lately, in an attempt to help sell their disk/magazines.
  341.  
  342. Most of the ones I've seen are *trash*, and the prices they charge
  343. are a bit outrageous, considering what they provide. I do not wish to
  344. help them.  Not even in a slight way.
  345.  
  346. Anyway, I hope nobody has a big problem with this. If you do, lemee
  347. hear from you.
  348.  
  349.  
  350.  
  351. The Future:
  352.  
  353. There will definitely be at least one more release of my version of
  354. "ls". It will address those items mentioned in the "What's Not Done"
  355. and "Known Bugs" sections above. In particular, it will support
  356. AmigaOS 2.0's enhancements, such as links. Given 2.0's probable
  357. availability, I doubt this will happen much before the end of 1990.
  358. We shall see.
  359.  
  360. In the meantime, let me hear from you if there are things you like
  361. (or don't). And especially if you find any bugs, "features", or
  362. anomalies. And if (God forbid), there's a useful option I've managed
  363. to overlook, don't hesitate to put in a request ... there are still a
  364. few option flags left ... :-)
  365.  
  366. In addition to my electronic addresses (see signature below), I can
  367. be reached at:
  368.  
  369.     Kim E. DeVaughn
  370.     750 Sylvan Av,  #32
  371.     Mt. View, CA  94041
  372.  
  373. However, email to my USENET/UUCP address is probably the surest way
  374. to get in touch with me, and should be used if at all possible.
  375.  
  376. /kim   /\oo/\
  377.  
  378. --
  379. UUCP:  kim@uts.amdahl.com
  380.   or:  {sun,decwrl,hplabs,pyramid,uunet,oliveb,ames}!amdahl!kim
  381. DDD:   408-746-8462
  382. USPS:  Amdahl Corp.  M/S 249,  1250 E. Arques Av,  Sunnyvale, CA 94086
  383. BIX:   kdevaughn     GEnie:   K.DEVAUGHN     CIS:   76535,25
  384.